home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 February / EnigmA AMIGA RUN 34 (1999)(G.R. Edizioni)(IT)[!][issue 1999-02].iso / www / amitrix / awn_1.7.lha / AWebNews_1.7 / news.awebrx < prev    next >
Text File  |  1996-12-24  |  36KB  |  1,336 lines

  1. /*
  2. $VER: AWebNews 1.7
  3. 22 Dec 1996
  4.  
  5. AWebNews the online News Reader for AWEB-II.
  6. By William H. M. Parker <bill@amitrix.com>
  7. All Rights Reserved DO NOT DISTRIBUTE
  8.  
  9.  
  10. Plugin usage:
  11.  
  12. command     sys:rexxc/rx
  13. arguments    AWeb-II:plugins/awebnews/news.awebrx %a
  14.  
  15. If you don't use an AWeb-II: assign you must use
  16.  
  17. arguments    FullPath/news.awebrx %a
  18. macro        Fullpath/news.awebrx
  19.  
  20. Note: ARexx limits file name length so the use of the assign is preferred.
  21.  
  22. */
  23.  
  24. /*Show Host first response at top of page use 'on' or 'off'*/
  25. showstartinfo='off'
  26.  
  27. /*Show calling parameters at top of page use 'on' or 'off'*/
  28. showcomand='off'
  29.  
  30. /* CHANGE THIS SCRIPT AND YOU COULD REGRET IT !
  31. ... rename and wildcard delete happen
  32. ... external comands are enabled
  33. */
  34.  
  35. options results
  36. signal on ioerr
  37. newsgroupsfile="newsgroups"
  38. maxmes=0
  39. lterm='0d'x
  40. term='.'||'0d'x
  41. fterm='.'||'0d'x||'0a'x
  42. bterm='0d'x||'0a'x||'.'||'0d'x||'0a'x
  43. ports = show('P')
  44. parse var ports dummy 'AWEB.' portnr .
  45. address value 'AWEB.' || portnr
  46. 'GET ACTIVEPORT'
  47. awebhost = result
  48. if ~show('L','rexxsupport.library') then
  49. if ~addlib('rexxsupport.library',0,-30,0) then
  50. exit(20)
  51.  
  52. parse arg addr
  53. parse source prog_type result_flag called resolved ext host .
  54.  
  55. last_slash = lastpos('/',called)
  56. last_colon = lastpos(':',called)
  57. dir_pos = max(last_slash,last_colon)
  58. if dir_pos > 0 then
  59. current_dir = left(called,dir_pos)
  60. else
  61. current_dir = ''
  62.  
  63.  
  64. address value awebhost
  65. address command 'delete T:configawebnews.#?.html >NIL:'
  66. if exists('t:awebnews.abort') then call delete('t:awebnews.abort')
  67. if exists('t:awebnews.ar') then call delete('t:awebnews.ar')
  68. fname='T:awebnews.'time(S)'.html'
  69. call readinfo
  70. if fun='ABORT' then call makeabort
  71. if fun='many subjects'  then do
  72.  fun='many'
  73. spec='sub'
  74. end
  75. if fun='all subjects'  then do
  76.  fun='all'
  77. spec='sub'
  78. end
  79. if fun='Kill Subject List' then do
  80. ft='group'
  81. call setclip('awnsub')
  82. end
  83. if ft='sl'  then do
  84. ft='message'
  85. spec='sel'
  86. end
  87. if ft='message' & fun='post'  then ft='group'
  88. if ft='meslist' & folu~=''  then do
  89.   ft='group'
  90.   fun='post'
  91. end
  92.  
  93. if sames='' &  fun~='post' & fun ~='post' &ft~='post' then do
  94.   address command 'delete T:awebnews.#?.html >NIL:'
  95. end
  96.  
  97. if ft='' then do
  98.   call firstinfo
  99.   parse var addr . '"' ngroup '"' .
  100.   if ngroup~=''then ft='group'
  101. end
  102. if many='' then many='10'
  103.  
  104. if NewsHost='' then do
  105.   call open(1,fname,w)
  106.   call writeln(1,'<html><head><title>AWebNews Error</title></head><body>')
  107.   call writeln(1,'<h1>AWebNews Error</h1>')
  108.   call writeln(1,'<b>You have not configured your NewsHost.</b><p>')
  109.   call writeln(1,'Please run ConfigNews script <br>')
  110.   call writeln(1,'<a href="x-aweb:rexx/'current_dir'confignews.awebrx">Configuration </a>')
  111.   call close(1)
  112.   'OPEN file://localhost/'fname
  113.   'SCREENTOFRONT'
  114.   exit
  115. end
  116.  
  117.  
  118.  
  119. call pragma(w,n)
  120. if ~showlist(H,'TCP') then do
  121.   call open(1,fname,w)
  122.   call writeln(1,'<html><head><title>AWebNews Error</title></head><body>')
  123.   call writeln(1,'<h1>AWebNews Error</h1>')
  124.   call writeln(1,'<b>Can not find TCP: on your system.</b><p>')
  125.   call close(1)
  126.   'OPEN file://localhost/'fname
  127.   'SCREENTOFRONT'
  128.   exit
  129. end
  130.  
  131.  
  132. if sames~='' then do
  133.   call savemes
  134.   'OPEN file://localhost/'fname
  135.   'SCREENTOFRONT'
  136.   exit
  137. end
  138.  
  139. if  fun='batch groups' then do
  140.   if  open(1,fname,w) then do
  141.     call htmltop
  142.     call batchform
  143.     call htmlbottom
  144.     'OPEN file://localhost/'fname'#bpage'
  145.     'SCREENTOFRONT'
  146.     'ACTIVATEWINDOW'
  147.     'ALLOWCMD'
  148.   end
  149.   exit
  150. end
  151.  
  152. if ft='batch' then do
  153.   call batchchecked
  154.   'OPEN file://localhost/'fname'#batch'
  155.   'SCREENTOFRONT'
  156.   exit
  157. end
  158. intmes='0'
  159.  
  160.  
  161. if ft='message' then do
  162.  
  163.   if  fun = 'batch many' | fun='batch all' then do
  164.     call postinfo
  165.     call opennews
  166.     if exists(bfile)then mode='A'
  167.     else mode='W'
  168.     if    open(3,bfile,mode) then do
  169.       bcount=0
  170.       errlog=''
  171.       if  fun = 'batch many' then rlen= batchgroup(ngroup,many)
  172.       if  fun = 'batch all' then rlen= batchgroup(ngroup,0)
  173.       call close(3)
  174.       if rlen>0 then  errcode=999
  175.     end
  176.     if open(1,fname,w) then do
  177.       call htmltop
  178.       call groupform
  179.       call writeln(1,'<center><hr><a name = "batch"> </a>')
  180.       call writeln(1,'<a name = "mesl"> </a>')
  181.       call writeln(1,'<a name = "errlog"> </a>')
  182.       if errcode=999 then  do
  183.     call writeln(1,'<b>Error</b><br>')
  184.     call writeln(1,'Could not open <b>'bfile'</b><br>')
  185.       end
  186.  
  187.       else do
  188.      call writeln(1,'Error log <br>')
  189.     call writeln(1,'Batched 'bcount 'articles to file<b> 'bfile'</b><br>')
  190.     call writeln(1,'From 'ngroup'<br>')
  191.     if errlog~='' then call writeln(1,'</center> Batch log ' errlog '<br>')
  192.       end
  193.     call writeln(1,'<center>')
  194.        call jumps(5)
  195.     call writeln(1,'</center>')
  196.  
  197.       call closenews
  198.       call messform
  199.  
  200.       call htmlbottom
  201.  
  202.       'OPEN file://localhost/'fname'#batch'
  203.       'SCREENTOFRONT'
  204.       'ACTIVATEWINDOW'
  205.       'ALLOWCMD'
  206.       exit
  207.     end
  208.   end
  209.  
  210.   call opennews
  211.   call subscribenews (ngroup)
  212.   if fun='previous' then do
  213.     nextmes=nextmes-2
  214.     if nextmes < meslow  then nextmes = meslow
  215.   end
  216.   maxmes = nextmes
  217.  
  218.   if  fun = 'many' then do
  219.     maxmes = nextmes + many -1
  220.     if maxmes > meshi then maxmes = meshi
  221.   end
  222.   if  fun = 'all' then maxmes = meshi
  223.  
  224.   if open(1,fname,w) then do
  225.     call htmltop
  226.     call groupform
  227. if spec='sub' then    call subjectnews
  228. else do
  229. if spec='sel' then    call selheadnews
  230. else   call manyheadnews
  231. end
  232.     call closenews
  233.     call messform
  234.     call htmlbottom
  235.     call updategroup
  236. if spec='sub' | subkey='2' then     'OPEN file://localhost/'fname'#subl'
  237. else    'OPEN file://localhost/'fname'#mesl'
  238. call setclip('awebnewshome',fname)
  239.     'SCREENTOFRONT'
  240.     'ACTIVATEWINDOW'
  241.     'ALLOWCMD'
  242.     exit
  243.   end
  244. end
  245.  
  246. /*external startup not from own html or aweb faking it*/
  247.  
  248. if ft='' then do
  249.   if open(1,fname,w) then do
  250.     call htmltop
  251.     call groupform
  252.     call htmlbottom
  253.     'OPEN file://localhost/'fname'#subscribe'
  254.  call setclip('awebnewshome',fname)
  255.     'SCREENTOFRONT'
  256.     'ACTIVATEWINDOW'
  257.     'ALLOWCMD'
  258.   end
  259.   else address command 'RequestChoice "News Reader" "Can not open t:file" "Ok" pubscreen aweb >NIL:'
  260. end
  261.  
  262. if ft='post' then do
  263.   call opennews
  264.   call writeln(8,'post')
  265.   groupinfo = readln(8)
  266.   parse var groupinfo errcode groupinfo
  267.   if errcode < 400 then do
  268.     if open(1,fname,w) then do
  269.       call htmltop
  270.       postd = fixpostd(addr)
  271.       call writeln(8,postd)
  272.       call writeln(8,'.')
  273.       groupinfo = readln(8)
  274.       parse var groupinfo errcode groupinfo
  275.     end
  276.     call closenews
  277.     call writeln(1,'<center><hr>')
  278.     call writeln(1,'<a name = "postreply"> </a>')
  279.     if errcode > 399 then call writeln(1,'ERROR 'errcode'<br>')
  280.     else call writeln(1,'Posting completed<br>')
  281.     call writeln(1,groupinfo'<br>')
  282.     call htmlbottom
  283.     'OPEN file://localhost/'fname'#postreply'
  284.     'SCREENTOFRONT'
  285.     'ACTIVATEWINDOW'
  286.     'ALLOWCMD'
  287.   end
  288.   else address command 'RequestChoice "AWebNews " "'groupinfo'" "ERROR" pubscreen aweb >NIL:'
  289.   exit
  290. end
  291.  
  292.  
  293. else if ft='group' then do
  294.  
  295.   if open(1,fname,w) then do
  296.     if fun='post' then do
  297.       page='ppage'
  298.       call htmltop
  299.       call postform
  300.     end
  301.  
  302.     else do
  303.       page='messel'
  304.       call opennews
  305.       call subscribenews (ngroup)
  306.       call closenews
  307.       call htmltop
  308.       if errcode>399 then ngroup =ngroup' is NOT FOUND'
  309.       else  call groupcnt
  310.       call groupform
  311.       if errcode<400 then    call messform
  312.       else page='subscribe'
  313.     end
  314.  
  315.     call htmlbottom
  316.  
  317.     'OPEN file://localhost/'fname'#'page
  318. call setclip('awebnewshome',fname)
  319.     'SCREENTOFRONT'
  320.     'ACTIVATEWINDOW'
  321.     'ALLOWCMD'
  322.   end
  323. end
  324. exit
  325.  
  326.  
  327. groupform:
  328. call writeln(1,'<form action="x-aweb:rexx/'||called||'">')
  329. call writeln(1,'<center><hr>')
  330. call writeln(1,'<a name = "subscribe"></a>')
  331. call writeln(1,'<input type="hidden" value="group" name="ft"> ')
  332. call writeln(1,'Select NewsGroup or Enter NewsGroup Name ')
  333. call writeln(1,'<br><tt><input size=40 name="group" value='""'></tt>')
  334. call writeln(1,'<br><tt><select name="grouplist" size="5">')
  335.  
  336. if  open(7,current_dir||newsgroupsfile,r) then do
  337.  
  338.   groupinfo='.'
  339.   do   while groupinfo~=""
  340.     groupinfo = readln(7)
  341.     parse var groupinfo grp list
  342.     if grp=ngroup then    call writeln(1,'<option selected> 'grp)
  343.     else if grp~="" then call writeln(1,'<option> 'grp)
  344.  
  345.   end
  346.   call close(7)
  347. end
  348. call writeln(1,'</select></tt>')
  349.  
  350. if ngroup=''then call writeln(1,'<br>No NewsGroup Set')
  351. else  call writeln(1,'<br>Currrent NewsGroup <b>' ngroup'</b>')
  352. call writeln(1,'<br>')
  353. call writeln(1,' <input type="submit" value="Set Current Group">')
  354. call writeln(1,' <input type="submit" value="batch groups" name="fun">')
  355. if ft ~='' & right(ngroup,5)~= 'FOUND' then call writeln(1,' <input type="submit" value="post" name="fun">')
  356. call writeln(1,'<br>')
  357. call jumps(1)
  358. call writeln(1,'<input type="hidden" value="1" name="nmess"> ')
  359. call hidestate 0
  360. call writeln(1,'</center></form>')
  361. return
  362.  
  363. messform:
  364. call writeln(1,'<form action="x-aweb:rexx/'||called||'">')
  365. call writeln(1,'<center><hr>')
  366. call writeln(1,'<input type="hidden" value="message" name="ft"> ')
  367. call writeln(1,'<a name = "messel"></a>')
  368. call writeln(1,'<a name="mes'intmes'"></a>')
  369. call writeln(1,'<a name="head'intmes'"></a>')
  370. call writeln(1,'Current NewsGroup - <b>'ngroup '</b><br>')
  371. call writeln(1,' contains 'mescount' articles #'meslow' - #'meshi'<br>')
  372. call writeln(1,'Next Article #<input size=7 name="nmess"value="'nextmes'"> ')
  373. call writeln(1,'How Many ? <input size=3 name="many" value="'many'"><br> ')
  374.  
  375. call writeln(1,'<input type="submit" value="many subjects" name="fun"> ')
  376. call writeln(1,'<input type="submit" value="all subjects" name="fun">')
  377. call writeln(1,' <input type="submit" value="post" name="fun"><br>')
  378. call writeln(1,'<input type="submit" value="read" name="fun"> ')
  379. call writeln(1,'<input type="submit" value="previous" name="fun"> ')
  380. call writeln(1,'<input name="fun" type="submit" value="many">')
  381. call writeln(1,'  <input name="fun" type="submit" value="all">')
  382. call writeln(1,' --<input type="submit" value="ABORT" name="fun">--<br>')
  383. call scnfg(1)
  384. call writeln(1,'<input name="fun" type="submit" value="batch many"> ')
  385. call writeln(1,'  <input name="fun" type="submit" value="batch all">')
  386. call writeln(1,' <input type="submit" value="batch groups" name="fun"><br>')
  387. call jumps(3)
  388. call hidestate 1
  389. call writeln(1,'</center></form>')
  390. return
  391.  
  392. htmltop:
  393. call writeln(1,'<html><head><title>')
  394. call writeln(1,'AWebNews Reader')
  395. call writeln(1,'</title></head>')
  396. if colo='on' then  call writeln(1,'<body bgcolor="'bacc'" text="'texc'">')
  397. if showcomand='on' then call writeln(1,addr '<br>')
  398. if showstartinfo='on' then call writeln(1,startinfo)
  399. return
  400.  
  401. htmlbottom:
  402. call writeln(1, '<hr></body></html>')
  403. call close(1)
  404. return
  405.  
  406.  
  407. readinfo:
  408. parse var addr . 'colo="' colo  '"' .
  409. parse var addr . 'bacc="' bacc '"' .
  410. parse var addr . 'texc="' texc '"' .
  411. parse var addr . 're-' folu '-' .
  412. parse var addr . 'sa-' sames '-' .
  413. parse var addr . 'host="' NewsHost '"' .
  414. parse var addr . 'nmess="' nextmes '"' .
  415. parse var addr . 'ft="' ft '"' .
  416. parse var addr . 'group="' ngroup '"' .
  417. if ngroup='' then parse var addr . 'grouplist="' ngroup '"' .
  418. ngroup=TRANSLATE(ngroup,xrange('a','z'), xrange('A','Z'))
  419. parse var addr . 'fun="' fun '"' .
  420. parse var addr . 'many="' many '"' .
  421. parse var addr . 'sho="' sho '"' .
  422. parse var addr . 'lho="' lho '"' .
  423. parse var addr . 'xprt="' xprt '"' .
  424. parse var addr . 'fcase="' fcase '"' .
  425. phil=fixphil(addr);
  426. parse var addr . 'philo="' philo '"' .
  427. parse var addr . 'scan="' scan '"' .
  428. return
  429.  
  430.  
  431. opennews:
  432. call openpro
  433. call writeln(con,'Waiting for Host')
  434.   if ~ open(8,'tcp:'NewsHost'/119',w) then do
  435.     address command 'RequestChoice "AWebNews " "Can Not Open Host 'NewsHost'" "Ok" pubscreen aweb >NIL:'
  436.     exit
  437.   end
  438.   startinfo = readln(8)
  439.   parse var startinfo errcode startinfo
  440. call writeln(con,startinfo)
  441. return
  442.  
  443. closenews:
  444. call writeln(8,'QUIT')
  445. call close(8)
  446. if progo='o' then call close(con)
  447. progo=''
  448. return
  449.  
  450. subscribenews:
  451. parse arg tgroup
  452. call writeln(8,'group 'tgroup)
  453. groupinfo = readln(8)
  454. call writeln(con,'0c'x ngroup )
  455. parse var groupinfo errcode mescount meslow meshi .
  456. return 0
  457.  
  458.  
  459. manyheadnews:
  460.  
  461. if nextmes < meslow then return
  462. if nextmes > meshi then return
  463. errlog=''
  464. oldnextmes=nextmes
  465. call meslisttop
  466.     call writeln(con,' ' )
  467. do while  nextmes <= maxmes
  468.     if exists('T:AWebNews.ABORT') then do
  469. if tryabort()="" then do
  470. maxmes=nextmes
  471. errlog=errlog||'<br> ABORT at ' nextmes '<br>'
  472. end
  473. end
  474.   call headnews
  475.   nextmes = nextmes + 1
  476. end
  477.  
  478.   call writeln(1,'<hr><b>' ngroup '</b> Article Texts' )
  479.   call writeln(1,'-<a href="file://localhost/'current_dir'AWebNews_doc.html#form_scan_ng">Help</a>')
  480.   call writeln(1,' - <a href="#errlog" >error log</a>')
  481. call mesnews
  482. call writeln(1,'<hr><a name="errlog"></a><center>')
  483. call jumps(0)
  484. call writeln(1,'Error Log</center>')
  485. if errlog~='' then call writech(1,errlog)
  486. else  call writech(1,'No Errors ')
  487. call meslistbottom
  488. return
  489.  
  490.  
  491. meslisttop:
  492. call writeln(1,'<form action="x-aweb:rexx/'||called||'">')
  493. call writeln(1,'<a name="mesl"></a>')
  494. call writeln(1,'<input type="hidden" value="meslist" name="ft"> ')
  495.  
  496. if  scan='on' then do
  497.   call writeln(1,'<hr><b> ' ngroup '</b> article Index List</b>' )
  498.   call writeln(1,'-<a href="file://localhost/'current_dir'AWebNews_doc.html#form_scan_ng">Help</a>')
  499.   call writeln(1,' - <a href="#errlog" >error log</a>')
  500. end
  501. return
  502.  
  503. meslistbottom:
  504.  
  505. call hidestate 0
  506. call writeln(1,'</form>')
  507.  
  508. return
  509.  
  510.  
  511. groupcnt:
  512. if ~open(7,current_dir||newsgroupsfile,r) then call  open(7,current_dir||newsgroupsfile,w)
  513. do
  514.  
  515.   groupinfo = readln(7)
  516.   parse var groupinfo grp cnt .
  517.  
  518.   do   while grp~ = ngroup & groupinfo ~= ''
  519.     groupinfo = readln(7)
  520.  
  521.     parse var groupinfo grp cnt .
  522.   end
  523.   if grp=ngroup then  nextmes = cnt
  524.   else    call writeln(7,ngroup meslow)
  525.   call close(7)
  526.  
  527. end
  528. if nextmes='' | nextmes < meslow then nextmes = meslow
  529. return
  530.  
  531. updategroup:
  532. if  open(6,current_dir||newsgroupsfile'.new',w) then  do
  533.   if  open(7,current_dir||newsgroupsfile,r) then do
  534.     do until groupinfo = ''
  535.       groupinfo = readln(7)
  536.       parse var groupinfo grp cnt xtra .
  537.       if ft='batch' then do
  538.     if grp = ngroup then call writeln(6,grp nextmes ' batch')
  539.     else if grp~='' then call writeln(6,grp cnt xtra)
  540.       end
  541.       else do
  542.     if grp = ngroup then call writeln(6,grp nextmes xtra)
  543.     else if grp~='' then call writeln(6,grp cnt xtra)
  544.       end
  545.  
  546.     end
  547.     call close(7)
  548.   end
  549.   call close(6)
  550.   if  exists(current_dir||newsgroupsfile) then  call delete(current_dir||newsgroupsfile)
  551.   call rename(current_dir||newsgroupsfile'.new', current_dir||newsgroupsfile)
  552. end
  553.  
  554. return
  555. cleargroup:
  556. if  open(6,current_dir||newsgroupsfile'.new',w) then  do
  557.   if  open(7,current_dir||newsgroupsfile,r) then do
  558.     do until groupinfo = ''
  559.       groupinfo = readln(7)
  560.       parse var groupinfo grp cnt xtra
  561.       if grp~='' then call writeln(6,grp cnt )
  562.  
  563.     end
  564.     call close(7)
  565.   end
  566.   call close(6)
  567.   if  exists(current_dir||newsgroupsfile) then  call delete(current_dir||newsgroupsfile)
  568.   call rename(current_dir||newsgroupsfile'.new', current_dir||newsgroupsfile)
  569. end
  570.  
  571. return
  572.  
  573. firstinfo:
  574. if  open(2,current_dir||'newsconfig',r) then do
  575.   configinfo = readch(2,3000)
  576.  
  577.   parse var configinfo . 'colo ' colo '0a'x
  578.   parse var configinfo . 'texc ' texc '0a'x
  579.   parse var configinfo . 'bacc ' bacc '0a'x
  580.   parse var configinfo . 'bfile ' bfile '0a'x
  581.   parse var configinfo . 'host ' NewsHost '0a'x
  582.   parse var configinfo . 'many ' many '0a'x
  583.   parse var configinfo . 'sho ' sho '0a'x
  584.   parse var configinfo . 'lho ' lho '0a'x
  585.   parse var configinfo . 'scan ' scan '0a'x
  586.   parse var configinfo . 'phil ' phil '0a'x
  587.   parse var configinfo . 'philo ' philo '0a'x
  588.   parse var configinfo . 'fcase ' fcase '0a'x
  589.   call close(2)
  590. end
  591. return
  592.  
  593. postform:
  594.  
  595. call postinfo
  596. call writeln(1,'<form action="x-aweb:rexx/'||called||'">')
  597. call writeln(1,'<a name="ppage"></a>')
  598. call writeln(1,'<input type="hidden" value="post" name="ft"> ')
  599. call writeln(1,'<hr><a name = "messel"> </a>')
  600. call writeln(1,'<center>Post an Article')
  601. call writeln(1,'-<a href="file://localhost/'current_dir'AWebNews_doc.html#form_post">Help</a>')
  602. call writeln(1,'<textarea name="postd" cols='taw' rows='tah'>')
  603. subject=''
  604. from=''
  605. mdate=''
  606. if folu~='' then do
  607.   call opennews
  608.   call subscribenews (ngroup)
  609.   call writeln(8,'head ' folu)
  610.   mesinfo = readln(8)
  611.   parse var mesinfo errcode mesinfo
  612.   if errcode <400 then do
  613.     do    until scaninfo = term
  614.       scaninfo = readln(8)
  615.       if subject='' then        parse var scaninfo . 'Subject:' subject '0d'x
  616.       if from='' then           parse var scaninfo . 'From:' from  '0d'x
  617.       if mdate='' then          parse var scaninfo . 'Date:' mdate '0d'x
  618.     end
  619.   end
  620.   if left(subject,3) ~= ' re' & left(subject,3) ~= ' Re' then subject =' Re:'subject
  621. end
  622.  
  623.  
  624. call writeln(1,'NewsGroups: 'ngroup)
  625. if disto='on' then call writeln(1,'Distribution: 'disth)
  626. if heado='on' then do
  627.   if  open(3,headf,r) then do
  628.     do until headinfo = ''
  629.       headinfo=readln(3)
  630.       if headinfo~="" then call writeln(1,fixhtml(headinfo))
  631.     end
  632.     call close(3)
  633.   end
  634. end
  635. call writeln(1,'X-Newsreader: AWebNews ')
  636. if repo='on' then call writeln(1,'Reply-To: 'fixhtml(reph))
  637. call writeln(1,'From: 'fixhtml(eadr))
  638. call writeln(1,'Subject:'fixhtml(subject) )
  639. call writeln(1,'' )
  640. call writeln(1,'--' )
  641. if folu~='' then do
  642.   call writeln(1,'On 'mdate', 'fixhtml(from)' wrote ...' )
  643.  
  644.   if qhead='on'then do
  645.     call writeln(8,'head ' folu)
  646.     mesinfo = readln(8)
  647.     parse var mesinfo errcode mesinfo
  648.     if errcode <400 then do
  649.       do  until scaninfo = term
  650.     scaninfo = readln(8)
  651.  
  652.     if scaninfo ~= term then call writeln(1,' > 'fixhtml(scaninfo))
  653.       end
  654.     end
  655.   end
  656.  
  657.   if qbody='on'then do
  658.     call writeln(8,'body ' folu)
  659.     mesinfo = readln(8)
  660.     parse var mesinfo errcode mesinfo
  661.     if errcode <400 then do
  662.       do  until scaninfo = term
  663.     scaninfo = readln(8)
  664.     if scaninfo ~= term then call writeln(1,' > 'fixhtml(scaninfo))
  665.       end
  666.     end
  667.   end
  668. call writeln(1,'--' )
  669.  
  670. end
  671.  
  672. if sigo='on' then do
  673.   if  open(3,sigf,r) then do
  674.     do until siginfo = ''
  675.       siginfo=readln(3)
  676.       call writeln(1,fixhtml(siginfo))
  677.     end
  678.     call close(3)
  679.   end
  680. end
  681. call writeln(1,'</textarea>')
  682. call hidestate    0
  683. call writeln(1,'<input type="submit" value="Post Article"></form>')
  684. return
  685.  
  686. postinfo:
  687.  
  688. if  open(2,current_dir||'newsconfig',r) then do
  689.   configinfo = readch(2,3000)
  690.   parse var configinfo . 'bfile ' bfile '0a'x
  691.   parse var configinfo . 'eadr ' eadr '0a'x
  692.   parse var configinfo . 'disto ' disto '0a'x
  693.   parse var configinfo . 'disth ' disth '0a'x
  694.   parse var configinfo . 'repo ' repo '0a'x
  695.   parse var configinfo . 'reph ' reph '0a'x
  696.   parse var configinfo . 'sigo ' sigo '0a'x
  697.   parse var configinfo . 'sigf ' sigf '0a'x
  698.   parse var configinfo . 'heado ' heado '0a'x
  699.   parse var configinfo . 'headf ' headf '0a'x
  700.   parse var configinfo . 'qhead ' qhead '0a'x
  701.   parse var configinfo . 'qbody ' qbody '0a'x
  702.   parse var configinfo . 'tah ' tah '0a'x
  703.   parse var configinfo . 'taw ' taw '0a'x
  704.   parse var configinfo . 'spath ' spath '0a'x
  705.  
  706.   call close(2)
  707. end
  708. return
  709.  
  710. savemes:
  711.  
  712. call postinfo
  713. address command ' requestfile >t:awebnews.ar savemode 'spath' file 'ngroup'.'sames' title "AWebNews Article Save" positive SAVE pubscreen aweb'
  714. if rc>0 then exit
  715. call open(3,'t:awebnews.ar',r)
  716. savename=readch(3,300)
  717. call close(3)
  718. parse var savename '"' savename '"'
  719. if  open(3,savename,w) then do
  720.   call opennews
  721.   call subscribenews (ngroup)
  722.   if  readtostr(article,sames)>0 then call writech(3,left(scaninfo,length(scaninfo)-3))
  723.   call closenews
  724.   call close(3)
  725. end
  726. else do
  727.   errcode=999
  728.   mesinfo='Could not open <b> 'savename'</b>'
  729. end
  730.  
  731. if open(1,fname,w) then do
  732. call htmltop
  733.   if errcode>399 then do
  734.     call writeln(1,'<h1>AWebNews Error</h1>')
  735.     call writeln(1,'<b>Article not saved</b><p>')
  736.     call writeln(1,mesinfo'<p>')
  737.   end
  738.   else
  739.   call writeln(1,'<h2> Article Saved O.K.</h2><p>')
  740.   call writeln(1,savename '<p>')
  741. end
  742. call htmlbottom
  743. return
  744.  
  745. readtostr:
  746. parse arg comtype,temp
  747. call writeln(8,comtype' 'temp)
  748. mesinfo = readln(8)
  749. parse var mesinfo errcode mesinfo
  750. if errcode>399 then return 0
  751. scaninfo=""
  752. do  until lineinfo=term
  753.   lineinfo = readln(8)
  754.   scaninfo = scaninfo||lineinfo
  755. end
  756. scaninfo=  TRANSLATE(scaninfo,'0a'x , '0d'x )
  757. return length(scaninfo)
  758.  
  759. batchgroup:
  760.  
  761. parse arg tgroup,btemp
  762. ngroup =tgroup
  763.  
  764. call subscribenews(tgroup)
  765.     call writeln(con,' ' )
  766. if errcode<400 then do
  767.   if nextmes='' then call groupcnt
  768.   if btemp=0 then maxmes = meshi
  769.   else maxmes = nextmes + btemp - 1
  770.   if maxmes > meshi then maxmes = meshi
  771.   if nextmes<=maxmes then  errlog=errlog||'<br>'tgroup' o.k., getting 'nextmes'- 'maxmes
  772.   else    errlog=errlog||'<br>'tgroup' o.k., no articles'
  773.   btemp=0
  774.   do while nextmes<=maxmes
  775.     call writeln(con,'9b41'x maxmes - nextmes +1 '    ')
  776.     if exists('T:AWebNews.ABORT') then do
  777. if tryabort()="" then do
  778. maxmes=nextmes
  779. listwork=''
  780. errlog=errlog||'<br> ABORT at ' nextmes '<br>'
  781. end
  782. end
  783.     rlen = readtostr(article,nextmes)
  784. if philo='on' & filter(scaninfo)=0 then do
  785. rlen=0
  786. mesinfo='filtered out'
  787. end
  788.  
  789.     if rlen >  0 then do
  790.       call  = writeln(3,'#! rnews' length(scaninfo)-2)
  791.       rlen= writech(3,left(scaninfo,length(scaninfo)-2))
  792.     end
  793.     else errlog=errlog||'<br> - 'tgroup||' 'nextmes' '||mesinfo
  794.  
  795.  
  796.     nextmes=nextmes+1
  797.     btemp=btemp+1
  798.   end
  799.   bcount=bcount+btemp
  800. call updategroup
  801.   return 0
  802. end
  803. else errlog=errlog||'<br>NO GROUP 'tgroup||' '||groupinfo
  804.  
  805. return 1
  806.  
  807.  
  808. fixhtml: procedure
  809. parse arg a
  810. a=a'-'
  811. c=''
  812. parse var a b '&' a
  813. do while a~=''
  814.   c=c||b'&'
  815.   parse var a b '&' a
  816. end
  817. a=c||b
  818.  
  819. c=''
  820. parse var a b '<' a
  821. do while a~=''
  822.   c=c||b'<'
  823.   parse var a b '<' a
  824. end
  825. a=c||b
  826. c=''
  827.  
  828. parse var a b '>' a
  829. do while a~=''
  830.   c=c||b'>'
  831.   parse var a b '>' a
  832. end
  833. a=c||b
  834. return left(a,length(a)-1)
  835.  
  836. fixta: procedure
  837. parse arg a
  838. a=fixhtml(a)
  839. a=a'-'
  840. c=''
  841. parse var a b '"' a
  842. do while a~=''
  843.   c=c||b'"'
  844.   parse var a b '&' a
  845. end
  846. a=c||b
  847. return left(a,length(a)-1)
  848.  
  849.  
  850. batchform:
  851. call writeln(1,'<form action="x-aweb:rexx/'||called||'">')
  852. call writeln(1,'<a name="bpage"></a>')
  853. call writeln(1,'<hr><center>')
  854. call writeln(1,'Select NewsGroups to Batch')
  855. call writeln(1,'<br><select multiple name="grouplist" size="5">')
  856.  
  857. if  open(7,current_dir||newsgroupsfile,r) then do
  858.  
  859.   groupinfo='.'
  860.   do   while groupinfo~=""
  861.     groupinfo = readln(7)
  862.     parse var groupinfo grp tmes bstat list
  863.     if grp~="" then do
  864.       if bstat ='batch' then call writeln(1,'<option selected> 'grp)
  865.       else call writeln(1,'<option> 'grp)
  866.     end
  867.   end
  868.   call close(7)
  869. end
  870. call writeln(1,'</select><br>')
  871. call writeln(1,' <input type="submit" value="batch checked groups">')
  872. call writeln(1,' --<input type="submit" value="ABORT" name="fun">--<br>')
  873. call scnfg(0)
  874. call writeln(1,'<input type="hidden" value="batch" name="ft"> ')
  875. call writeln(1,'<a href="file://localhost/'current_dir'AWebNews_doc.html#form_batch_ng">Help</a> - ')
  876. call writeln(1,'<a href="x-aweb:rexx/'current_dir'news.awebrx">Read News </a>')
  877. call writeln(1,' - <a href="x-aweb:rexx/'current_dir'confignews.awebrx">Config / Maintain Groups </a>')
  878. call hidestate 0
  879. call writeln(1,'</form>')
  880. return
  881.  
  882. batchchecked:
  883. call postinfo
  884. call cleargroup
  885. if exists(bfile) then mode='A'
  886. else mode='W'
  887. if  open(3,bfile,mode) then do
  888.   bcount=0
  889.   errlog=''
  890.   call opennews
  891.   listwork=addr
  892.   do until nextgrp=''
  893.     parse var listwork . 'grouplist="' nextgrp '"' listwork
  894.     if nextgrp~='' then do
  895.       nextmes=''
  896.       call batchgroup(nextgrp,0)
  897.     end
  898.   end
  899.   call closenews
  900.   call close(3)
  901. end
  902. else errcode =999
  903. if open(1,fname,w) then do
  904.   call htmltop
  905.   call batchform
  906.   call writeln(1,'<hr><a name = "batch"></a><center>Error log<br>')
  907.   if errcode=999 then  do
  908.     call writeln(1,'<b>Error</b><br>')
  909.     call writeln(1,'Could not open 'bfile'<br>')
  910.   end
  911.  
  912.   else do
  913.     call writeln(1,'Batched 'bcount 'articles to file <b>'bfile'</b><br>')
  914.     call writeln(1,'From Selected Groups</center>')
  915.     if errlog~=''then call writeln(1,'<br> Batch log'errlog '<br>')
  916.   end
  917.  call writeln(1,'<center>')
  918.   call jumps(6)
  919.  call writeln(1,'</center>')
  920.   call htmlbottom
  921. end
  922. return
  923.  
  924.  
  925. headnews:
  926. if spec='sel' then call writeln(con,'9b41'x  nextmes '    ')
  927. else call writeln(con, '9b41'x maxmes-nextmes+1 '    ')
  928. rlen= readtostr(article,nextmes)
  929. if philo='on' & filter(scaninfo)=0 then do
  930. errcode=888
  931. mesinfo='filtered out'
  932. end
  933.  
  934. if errcode<400 then do
  935. mesfound='y'
  936.   scaninfo=makelink(fixhtml(scaninfo))
  937.   call setclip('awebnews_'nextmes,scaninfo)
  938.   if scan='on' then do
  939.  
  940.     parse var scaninfo scaninfo '0a0a'x bodyinfo
  941.     parse var scaninfo    'Reply-To:' reply '0a'x
  942.     parse var scaninfo    'Subject:' subject '0a'x
  943.     parse var scaninfo    'From:' from      '0a'x
  944.     parse var scaninfo    'Date:' mdate     '0a'x
  945.  
  946.     call writeln(1,'<hr><center>')
  947.     call writeln(1,' #'nextmes)
  948.     call writeln(1,' - <a href="#mes'intmes'" >read</a>')
  949.  
  950.     call writeln(1,' - <a href="#head'intmes+1'" name="head'intmes'">next</a>')
  951.     if intmes>0 then call writeln(1,' - <a href="#head'intmes-1'" >previous</a>')
  952.     call writeln(1,' - <a href="#mesl" >top</a> - <a href="#messel"> more</a>')
  953.     call writeln(1,' - <input type="submit" value="follow up" name="re-'nextmes'-">')
  954.     call writeln(1,' - <input type="submit" value="save" name="sa-'nextmes'-">')
  955.     intmes=intmes+1
  956.     call writeln(1,'<br>')
  957.     call writeln(1,'</center>')
  958.     call writeln(1,' Subject : 'subject'<br>')
  959.     call writeln(1,' Date : 'mdate'<br>')
  960.     if reply~=''then do
  961.       call writeln(1,'Reply-To: <A HREF="mailto:'fixmailto(reply)'"><I>'reply'</I></A><BR>')
  962.       call writeln(1,' From: 'from)
  963.     end
  964.     else call writeln(1,'From: <A HREF="mailto:'fixmailto(from)'"><I>'from'</I></A>')
  965.  
  966.   end
  967. end
  968. else  errlog=errlog||'Article not found 'nextmes' 'mesinfo'<br>'
  969. return
  970.  
  971. mesnews:
  972. if mesfound~='y' then do
  973. call writeln(1,' No articles retreived.<br>')
  974. return
  975. end
  976. intmes=0
  977. clips= show('C')
  978. call writeln(con,'0c'x 'processing')
  979.  
  980. do while clips~=''
  981.   parse var clips 'awebnews_' clipmes clips
  982.   if clipmes~='' then do
  983.     call writech(con,'.')
  984.     scaninfo= getclip('awebnews_'clipmes)
  985.     parse var scaninfo scaninfo '0a0a'x bodyinfo
  986.  
  987.     call writeln(1,'<hr> <center># 'clipmes )
  988.     if scan ='on' then call writeln(1,' - <a href="#head'intmes'" >Index</a>')
  989.     call writeln(1,' - <a href="#mes'intmes+1'" name="mes'intmes'">next</a>')
  990.     if intmes>0 then call writeln(1,' - <a href="#mes'intmes-1'" >previous</a>')
  991.     call writeln(1,' - <a href="#mesl" >top</a> - <a href="#messel"> more</a>')
  992.     call writeln(1,' -  <input type="submit" value="follow up" name="re-'clipmes'-">')
  993.     call writeln(1,' - <input type="submit" value="save" name="sa-'clipmes'-">')
  994.     intmes=intmes+1
  995.     call writeln(1,'</center>')
  996.  
  997.     if sho='on'then do
  998.       parse var scaninfo  'Reply-To: ' reply '0a'x
  999.       parse var scaninfo  'Subject:' subject '0a'x
  1000.       parse var scaninfo  'From:' from      '0a'x
  1001.       parse var scaninfo  'Date:' mdate     '0a'x
  1002.  
  1003.       call writeln(1,' Subject : 'subject'<br>')
  1004.       call writeln(1,' Date : 'mdate'<br>')
  1005.       if reply~=''then do
  1006.     call writeln(1,'Reply-To: <A HREF="mailto:'fixmailto(reply)'"><I>'reply'</I></A><BR>')
  1007.     call writeln(1,' From: 'from)
  1008.       end
  1009.       else call writeln(1,'From: <A HREF="mailto:'fixmailto(from)'"><I>'from'</I></A>')
  1010.     end
  1011.     if lho='on' then do
  1012.       call writeln(1,'<pre >')
  1013.       call writeln(1,scaninfo)
  1014.       call writeln(1,'</pre>' )
  1015.     end
  1016.     call writeln(1,'<br><pre>')
  1017.     if sho~='on' & h~='on' then do
  1018.       parse var scaninfo  'Subject:' subject '0a'x
  1019.       call writeln(1,' Subject : 'subject)
  1020.     end
  1021. if length(bodyinfo)>2 then   call writeln(1,left(bodyinfo,length(bodyinfo)-2))
  1022.     call writeln(1,'</pre>' )
  1023.     call setclip('awebnews_'clipmes)
  1024.   end
  1025. end
  1026. return
  1027.  
  1028. fixpostd: procedure
  1029. parse arg a
  1030. c=''
  1031. parse var a b '*"' a
  1032. do while a~=''
  1033.   c=c||b'*q'
  1034.   parse var a b '*"' a
  1035. end
  1036. a=c||b
  1037. parse var a . 'postd="' a '"' .
  1038. c=''
  1039. parse var a b '*' a
  1040. do while a~=''
  1041.   d=left(a,1)
  1042.   if d='N' then  c=c||b||'0a'x
  1043.   else if d='q' then  c=c||b||'"'
  1044.   else if d='"'|d='*'|d="'"|d='$'then c=c||b||d
  1045.   else    do
  1046.     c=c||b||'*'
  1047.     a=d||a
  1048.   end
  1049.   parse VALUE (substr(a,2)) WITH b '*' a
  1050. end
  1051. return c||b
  1052.  
  1053. fixphil: procedure
  1054. parse arg a
  1055. c=''
  1056. parse var a b '*"' a
  1057. do while a~=''
  1058.   c=c||b'*q'
  1059.   parse var a b '*"' a
  1060. end
  1061. a=c||b
  1062. parse var a . 'phil="' a '"' .
  1063. c=''
  1064. parse var a b '*' a
  1065. do while a~=''
  1066.   d=left(a,1)
  1067.   if d='N' then  c=c||b||'0a'x
  1068.   else if d='q' then  c=c||b||'"'
  1069.   else if d='"'|d='*'|d="'"|d='$'then c=c||b||d
  1070.   else    do
  1071.     c=c||b||'*'
  1072.     a=d||a
  1073.   end
  1074.   parse VALUE (substr(a,2)) WITH b '*' a
  1075. end
  1076. return c||b
  1077.  
  1078. ioerr:
  1079. address command 'RequestChoice "AWebNews " "'NewsHost' not responding" "Ok" pubscreen aweb >NIL:'
  1080. exit
  1081.  
  1082. openpro:
  1083. if progo='o' then call close(con)
  1084. call open(con,'con://300/50/AWebNews   ' NewsHost'/close/inactive/screen aweb')
  1085. progo='o'
  1086. return
  1087.  
  1088. filtersubjects:
  1089. procedure expose phil fcase
  1090. parse arg a
  1091. c=''
  1092. do while a~=''
  1093. parse var a b '0a'x a
  1094. if filter(b) =1 then c=c||b||'0a'x
  1095. end
  1096. return c
  1097.  
  1098.  
  1099. subjectnews:
  1100. call writeln(con,'Subjects ' maxmes-nextmes+1)
  1101. rlen= readtostr('xhdr Subject',nextmes'-'maxmes)
  1102. if errcode<400 then do
  1103. if philo='on' then scaninfo=filtersubjects(scaninfo)
  1104. scaninfo=fixhtml(scaninfo)
  1105. if ngroup=getclip('awnoldngroup')then scaninfo=getclip('awnsub')||scaninfo
  1106. call setclip('awnsub',left(scaninfo,length(scaninfo)-2))
  1107. call setclip('awnoldngroup',ngroup)
  1108. nextmes = maxmes+1
  1109. call updategroup
  1110. call subjectform
  1111. end
  1112. return
  1113.  
  1114. subjectform:
  1115. scaninfo=getclip('awnsub')
  1116. call writeln(1,'<form action="x-aweb:rexx/'||called||'">')
  1117.       call writeln(1,'<center><hr><a name = "subl"></a>')
  1118.  
  1119. if scaninfo='' then  do
  1120.       call writeln(1,'No articles in subject list.<br>')
  1121. end
  1122. else do
  1123.     call writeln(1,' <a  name="mes'intmes'"></a>')
  1124.     call writeln(1,' <a  name="mes'intmes'"></a>')
  1125. call writeln(1,'Subjects from articles in <b>' ngroup'</b>')
  1126.  
  1127. call writeln(1,'<br><select multiple name="sublist" size="10">')
  1128.  
  1129. do while scaninfo~=''
  1130. parse var scaninfo subject '0a'x scaninfo
  1131. if subject~='.'then call writeln(1,'<option> 'left(subject,75))
  1132. end
  1133. call writeln(1,'</select><br>')
  1134. call writeln(1,' <input type="submit" value="Read selected articles" name="fun">')
  1135. call writeln(1,' <input type="submit" value="Read all articles" name="fun">')
  1136. call writeln(1,' --<input type="submit" value="ABORT" name="fun">--<br>')
  1137. call writeln(1,' <input type="submit" value="Kill selected articles" name="fun">')
  1138. call writeln(1,' <input type="submit" value="Kill Subject List" name="fun"><br>')
  1139. call scnfg(1)
  1140. end
  1141. call jumps(2)
  1142. call writeln(1,'<input type="hidden"  name="ft" value="sl">')
  1143. call hidestate 1
  1144. call writeln(1,'<center></form>')
  1145. return
  1146.  
  1147. selheadnews:
  1148. errlog=''
  1149. oldnextmes=nextmes
  1150. subt=getclip('awnsub')
  1151. if fun='Read selected articles' then do
  1152. parse var addr subs
  1153. subkey='0'
  1154. end
  1155. if fun='Read all articles' then do
  1156. subkey='1'
  1157. subs=subt
  1158. end
  1159. if fun='Kill selected articles' then do
  1160. subkey='2'
  1161. parse var addr subs
  1162. end
  1163. if subkey~='2' then call meslisttop
  1164.     call writeln(con,' ' )
  1165. do while  subs~=''
  1166. if subkey='1' then parse var subs nextmes . '0a'x subs
  1167. else parse var subs . 'sublist="'nextmes ' ' subs
  1168. parse var subt subt (nextmes) '0a'x subtt
  1169. subt=subt||subtt
  1170.     if exists('T:AWebNews.ABORT') then do
  1171. if tryabort()="" then do
  1172. subs=''
  1173. errlog=errlog||'<br> ABORT at ' nextmes '<br>'
  1174. end
  1175. end
  1176.  
  1177. if nextmes~='' & subkey~='2' then  call headnews
  1178. end
  1179. call setclip('awnsub',subt)
  1180. nextmes=oldnextmes
  1181.  
  1182. if subkey~='2' then do
  1183.   call writeln(1,'<hr><b>' ngroup '</b> Selected Texts' )
  1184.   call writeln(1,'- <a href="file://localhost/'current_dir'AWebNews_doc.html#form_scan_ng">Help</a>')
  1185.   call writeln(1,' - <a href="#errlog" >error log</a>')
  1186. call mesnews
  1187. call writeln(1,'<hr><a name="errlog"></a><center>')
  1188. call jumps(4)
  1189. call writeln(1,'Error Log</center>')
  1190. if errlog~='' then call writech(1,errlog)
  1191. else  call writech(1,'No Errors ')
  1192. call meslistbottom
  1193. end
  1194. call subjectform
  1195. return
  1196.  
  1197.  
  1198. hidestate:
  1199. parse arg jt
  1200. call writeln(1,'<input type="hidden"  name="colo" value="'colo'">')
  1201. call writeln(1,'<input type="hidden" name="bacc" value="'bacc'">')
  1202. call writeln(1,'<input type="hidden" name="texc" value="'texc'">')
  1203. call writeln(1,'<input type="hidden" value="'NewsHost'" name="host"> ')
  1204. call writeln(1,'<input type="hidden" value="'many'" name="many"> ')
  1205. if jt~=1 then do
  1206. call writeln(1,'<input type="hidden" value="'fcase'" name="fcase"> ')
  1207. call writeln(1,'<input type="hidden" value="'phil'" name="phil"> ')
  1208. call writeln(1,'<input type="hidden" value="'philo'" name="philo"> ')
  1209. call writeln(1,'<input type="hidden" value="'sho'" name="sho"> ')
  1210. call writeln(1,'<input type="hidden" value="'lho'" name="lho"> ')
  1211. call writeln(1,'<input type="hidden" value="'scan'" name="scan"> ')
  1212. end
  1213. call writeln(1,'<input type="hidden" value="'ngroup'" name="group"> ')
  1214. call writeln(1,'<input type="hidden" value="'nextmes'" name="nmess"> ')
  1215. return
  1216.  
  1217.  
  1218. makelink: procedure
  1219. parse arg a
  1220. c=''
  1221. do while a~=''
  1222. parse var a  d 'http://' b  a
  1223. c=c||d
  1224. if b~='' then do
  1225. t= length(b)
  1226. parse var b b '0a'x d
  1227. c=c|| '<a href="http://' || b || '">http://' || b || '</a>'
  1228. if length(b)~=t then c= c || '0a'x || d
  1229. end
  1230. end
  1231. return c
  1232.  
  1233. filter: procedure expose phil fcase
  1234. parse arg t
  1235. t=upper(t)
  1236. a=phil
  1237. if fcase='on' then a=upper(a)
  1238. do until a=''
  1239. parse var a b ',' a
  1240. if left(b,1)='-' then do
  1241. if index(t,right(b,length(b)-1))>0 then t=''
  1242. end
  1243. if left(b,1)='+' then do
  1244. if index(t,right(b,length(b)-1))=0 then t=''
  1245. end
  1246. if left(b,1)='|' then do
  1247. if t~='' then return 1
  1248. parse arg t
  1249. if fcase='on' then t=upper(t)
  1250. end
  1251. if left(b,1)='~' then do
  1252. if t='' then do
  1253. parse arg t
  1254. if fcase='on' then t=upper(t)
  1255. end
  1256. else t=''
  1257. end
  1258. end
  1259. if t~='' then return 1
  1260. return 0
  1261.  
  1262. scnfg:
  1263. parse arg st
  1264. call writeln(1,'<hr width =50%>')
  1265. if st=1 then do
  1266. if scan = 'on' then call writeln(1,'Index List<input type="checkbox" checked name="scan"> ')
  1267. else call writeln(1,'Index List <input type="checkbox"  name="scan"> ')
  1268. if sho = 'on' then call writeln(1,'Short Header <input  type="checkbox" checked name="sho"> ')
  1269. else call writeln(1,'Short Header <input type="checkbox"  name="sho"> ')
  1270. if lho = 'on' then call writeln(1,'Long Header <input  type="checkbox" checked name="lho"> ')
  1271. else call writeln(1,'Long Header <input type="checkbox"  name="lho"> ')
  1272. call writeln(1,'<a href="file://localhost/'current_dir'AWebNews_doc.html#display"> Help</a>')
  1273. call writeln(1,'<br>')
  1274. end
  1275. call writeln(1,'Filter <input size=30 name="phil" value="'fixta(phil)'">')
  1276. if fcase = 'on' then call writeln(1,' Ignore Case <input type="checkbox" checked name="fcase"> ')
  1277. else call writeln(1,' Ignore Case  <input type="checkbox"  name="fcase"> ')
  1278. if philo = 'on' then call writeln(1,' Use Filter <input type="checkbox" checked name="philo"> ')
  1279. else call writeln(1,' Use Filter <input type="checkbox"  name="philo">')
  1280. call writeln(1,'<a href="file://localhost/'current_dir'AWebNews_doc.html#filter"> Help </a>')
  1281. call writeln(1,'<br>')
  1282. return
  1283. jumps:
  1284. parse arg jt
  1285. if jt=1 then call writeln(1,'<a href="file://localhost/'current_dir'AWebNews_doc.html#form_select_ng">Help</a>-')
  1286. if jt=3 then call writeln(1,'<a href="file://localhost/'current_dir'AWebNews_doc.html#form_curr_ng">Help</a>-')
  1287. if jt=2 then call writeln(1,'<a href="file://localhost/'current_dir'AWebNews_doc.html#form_subject">Help</a>-')
  1288. if jt=4 | jt=0 | jt=5 | jt=6 then call writeln(1,'<a href="file://localhost/'current_dir'AWebNews_doc.html#error_log">Help</a>-')
  1289.  
  1290. if jt=6 then  call writeln(1,'<a href="#bpage" > Batch Groups</a> - ')
  1291. if jt~=1 & jt~=6 then call writeln(1,'<a href="#subscribe" > New Group</a> - ')
  1292. if ft='message' then do
  1293.   if spec='sub' | spec='sel' then do
  1294.   if jt~=2 then  call writeln(1,'<a href="#subl">Subjects</a> - ')
  1295.   end
  1296.   if spec~='sub' then do
  1297.   if left(fun,5)~='batch' then call writeln(1,'<a href="#mesl"> Article Texts</a> - ')
  1298.   end
  1299.  if jt~=3 then call writeln(1,'<a href="#messel"> Get More Articles</a> - ')
  1300.  end
  1301. if ft='group' & right(ngroup,5)~= 'FOUND' then do
  1302. if jt~=3 then call writeln(1,'<a href="#messel"> Get Articles</a> - ')
  1303. end
  1304. call writeln(1,'<a href="x-aweb:rexx/'current_dir'confignews.awebrx">Config / Maintain Groups </a><br>')
  1305.  
  1306. return
  1307.  
  1308. tryabort:
  1309. procedure
  1310. call delete('t:awebnews.abort')
  1311. address command ' requestchoice AWebNews "Abort Request" Continue Abort pubscreen aweb >t:awebnews.ar'
  1312. call open(2,'t:awebnews.ar',r)
  1313. t=readch(2,1)
  1314. call close(2)
  1315. if t='0' then return('')
  1316. return (1)
  1317.  
  1318.  
  1319. makeabort:
  1320. procedure
  1321. if open(1,'t:AWebNews.ABORT',w) then call close(1)
  1322. exit
  1323.  
  1324.  fixmailto:
  1325. procedure
  1326. parse arg a
  1327. parse var a '<' b '>'
  1328. if b~='' then return b
  1329. c=a
  1330. do while a~=''
  1331. parse var a b a
  1332. if index(b,'@')>0 then return b
  1333. end
  1334. return strip(c)
  1335.  
  1336.